home *** CD-ROM | disk | FTP | other *** search
/ Aminet 41 / Aminet 41 (2001)(Schatztruhe)[!][Feb 2001].iso / Aminet / gfx / edit / AmiCAD_2.07.lha / AmiCAD / ARexx / Simulation.AmiCAD < prev    next >
Text File  |  2000-11-11  |  2KB  |  54 lines

  1. /* Lancement simulation analogique */
  2. /* Version 1.01: 8 Mai 1999 (ajout guillemets autour du nom du fichier, pour espaces éventuels) */
  3. /* Version 1.02: 11 Novembre 2000 (localisation anglais/français) */
  4. /* $VER: 1.02 (© R.Florac, 11 Novembre 2000) */
  5.  
  6. options results     /* indispensable pour récupérer le résultat des macros */
  7.  
  8. signal on error     /* pour l'interception des erreurs */
  9. signal on syntax
  10.  
  11. 'LANGUAGE'
  12. if result="français.language" then fr=1
  13. else fr=0
  14.  
  15. parse arg fichier
  16. if fichier="" then do
  17.     if fr=1 then 'REQFILE("Choix d''une netlist", "Spice", "*.cir")'
  18.     else 'REQFILE("Netlist file to simulate ?", "Spice", "*.cir")'
  19.     fichier=result
  20. end
  21. if fichier~="" then do
  22.     fichier_simulation='"RAM:'||ParseFileName(fichier)||'_spice"'
  23.     address command
  24.     'stack' " 64000"
  25.     if fr=1 then 'cd' " Travail:spice3f5"
  26.     else 'cd ' " Work:spice3f5"
  27.     arguments='"'||fichier||'"'||' -b -r '||fichier_simulation||' >CON:100/100/500/300/Spice/CLOSE/WAIT/SCREENAmiCAD'
  28.     address command
  29.     if fr=1 then 'Travail:spice3f5/bin/spice3f5full_040' arguments
  30.     else 'Work:spice3f5/bin/spice3f5full_040' arguments
  31. end
  32.  
  33. exit
  34.  
  35. ParseFileName: procedure
  36.     parse arg FilePath, Part
  37.     DivPos = max(lastpos(':',FilePath),lastpos('/',FilePath))+1
  38.     if abbrev('FILE', upper(Part))
  39.     then return substr(FilePath, DivPos)
  40.     else
  41.     return strip(left(FilePath, DivPos-1),'T','/')
  42.  
  43. /* Traitement des erreurs, interruption du programme */
  44. syntax:
  45. erreur=RC
  46. if fr=1 then 'MESSAGE("Erreur de syntaxe"+CHR(10)+"en ligne 'SIGL'"+CHR(10)+"'errortext(erreur)'")'
  47. else 'MESSAGE("Syntax error"+CHR(10)+"in line 'SIGL'"+CHR(10)+"'errortext(erreur)'")'
  48. exit
  49.  
  50. error:
  51. if fr=1 then 'MESSAGE("Erreur en ligne 'SIGL'")'
  52. else 'MESSAGE("Error in line 'SIGL'")'
  53. exit
  54.